#include <stdio.h>
#include "../header/ex2_ex.h"
#include "../header/util.h"

void ex21() {
	printf("Gustav Mahler\n");
	printf("Gustav\n");
	printf("Mahler\n");
	printf("Gustav Mahler\n");
}

void ex22() {
	printf("My name is xiaoming.\n");
	printf("My address is Yuexiu District, Guangzhou.\n");
}

void ex23() {
	int age = 34;
	int day = age * 365;
	printf("The number of days is %d.\n", day);
}

void jolly() {
	printf("For he's a jolly good fellow!\n");
}

void deny() {
	printf("Which nobody can deny!\n");
}

void ex24() {
	jolly();
	jolly();
	jolly();
	deny();
}

void br() {
	printf("Brazil, Russia");
}

void ic() {
	printf("India, China");
}

void ex25() {
	br();
	print_comma_space();
	ic();
	print_line();
	ic();
	print_comma();
	print_line();
	br();
	print_line();
}

void ex26() {
	int toes = 10;
	int doubleToes = 2 * toes;
	int toesSquare = toes * toes;
	printf("toes = %d, double toes = %d, square toes = %d\n", toes, doubleToes, toesSquare);
}

void smile() {
	printf("Smile!");
}

void ex27() {
	smile();
	smile();
	smile();
	print_line();
	smile();
	smile();
	print_line();
	smile();
	print_line();
}

void two() {
	printf("two\n");
}

void one_three() {
	printf("one\n");
	two();
	printf("three\n");
}

void ex28() {
	printf("starting now:\n");
	one_three();
	printf("done!");
}

void ex2_ex() {
	print_sep((char *) "ex1");
	ex21();
	
	print_sep((char *) "ex2");
	ex22();
	
	print_sep((char *) "ex3");
	ex23();
	
	print_sep((char *) "ex4");
	ex24();
	
	print_sep((char *) "ex5");
	ex25();
	
	print_sep((char *) "ex6");
	ex26();
	
	print_sep((char *) "ex7");
	ex27();
	
	print_sep((char *) "ex8");
	ex28();
}
